import authRequest from 'supports/requests/authRequest'
import normalRequest from 'supports/requests/normalRequest'

export function getGroupsProducts(data) {
  return authRequest('groups/products/all?include=product',{ data: data })
}

export function getGoodsGroupsList(id,data) {
  return authRequest('groups/list/' + id,{ data:data })
}

export function attendGroups(data) {
  return authRequest('groups/attend',{method: 'post', data: data})
}

export function getGroupsDetails(group_id) {
  return authRequest('groups/' + group_id )
}

export function getMyjoinsCollageList(data) {
  return authRequest('groups/my/joins',{data:data})
}

export function getMyOpensCollageList(data) {
  return authRequest('groups/my/opens',{data:data})
}

export function getMyRecordsCardList() {
  return authRequest('groups/records' )
}

export function startGroups(data) {
  return authRequest('groups/start' ,{method: 'post', data:data})
}

export function getGroupsBonusesList(time,data) {
  return authRequest('groups/bonuses?time=' +  time,{data:data})
}

export function takeBonuses(bonusesId) {
  return authRequest('groups/bonuses/' + bonusesId + '/take')
}


export function batchTakeBonuses() {
  return authRequest('groups/bonuses/batch/take')
}

export function orderDisplaces(data) {
  return authRequest('order/displaces',{data:data})
}

export function getOrderDisplacesProducts(id,data) {
  return authRequest('order/displaces/' + id + '/products',{data:data})
}

export function goodsDisplaces(data) {
  return authRequest('order/displaces',{method: 'post', data:data})
}

